/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ivanbiz.nilai;

import java.util.List;

/**
 *
 * @author User
 */
public class PenilaianServiceImpl implements PenilaianService {

    private PenilaianDAO penilaianDAO;
    private NilaiKriteriaDAO nilaiKriteriaDAO;

    public void setPenilaianDAO(PenilaianDAO penilaianDAO) {
        this.penilaianDAO = penilaianDAO;
    }

    public void setNilaiKriteriaDAO(NilaiKriteriaDAO nilaiKriteriaDAO) {
        this.nilaiKriteriaDAO = nilaiKriteriaDAO;
    }

    public void savePenilaian(Penilaian penilaian) throws Exception {
        this.penilaianDAO.save(penilaian);
    }

    public void deletePenilaian(Penilaian penilaian) throws Exception {
        this.penilaianDAO.delete(penilaian);
    }

    public void updatePenilaian(Penilaian penilaian) throws Exception {
        this.penilaianDAO.update(penilaian);
    }

    public List loadAll() throws Exception {
        return this.penilaianDAO.getAll(Penilaian.class);
    }

    public Penilaian loadById(long id) throws Exception {
        return (Penilaian) this.penilaianDAO.load(Penilaian.class, id);
    }

    public List getPenilaianByKelas(String id) throws Exception {
        return this.penilaianDAO.getPenilaianByKelas(id);
    }

    public List getPenilaianByNama(String nama) throws Exception {
        return this.penilaianDAO.getPenilaianByNama(nama);
    }

    public List getPenilaianByKelasAndNilaiKriteria(String kelasId, String nilaiKriteriaId) throws Exception {
        return this.penilaianDAO.getPenilaianByKelasAndNilaiKriteria(kelasId, nilaiKriteriaId);
    }
}
